
#include <fstream>
#include <iostream>
using namespace std;


int main( void ) {
	// ios::out
	ofstream ofsl( "./file", ios::out );
	if( !ofsl ) {
		cerr << "ofsl has some error" << endl;
	}
	ofsl << 1234 << ' ' << 56.78 << ' ' << "hello" << '\n' ;
	if( !ofsl ) {
		cerr << "ofsl statue has some error" << endl;
	}
	ofsl.close( );

	// ios::app
	ofstream ofs2( "./file", ios::app );
	if( !ofs2 ) {
		cerr << "ofs2 has something wrong" << endl;
	}
	ofs2 << "world" << endl;
	if( !ofs2 ) {
		cerr << "ofs2 written err" << endl;
	}

	return 0;
}

